count=0
for year in range(2022,2023):
    for month in range(1,13):
        for day in range(1,32):
            date_str=f"{year:04d}{month:02d}{day:02d}"
            if "012" in date_str or "123" in date_str or "234" in date_str or "345" in date_str or "456" in date_str or "567" in date_str or "678" in date_str or "789" in date_str:
                count+=1
                #print(date_str)
print(count)
